<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Đăng Nhập</title>
</head>
<%
	String getErr = (String) session.getAttribute("thongbao");
	String getSes = (String) session.getAttribute("email");
	String getCook = null;
	Cookie[] cookies = request.getCookies();
	if (cookies != null) {
		for (int i = 0; i < cookies.length; i++) {
			if (cookies[i].getName().equals("email")) {
				getCook = cookies[i].getValue();
				break;
			}
			
			
		}
	}
	if (getSes != null || getCook != null) {
		response.sendRedirect("accountManager.jsp");
	}
%>

<body>
	<center>
		<fieldset style="width: 300px;">
			<legend>Đăng nhập</legend>
			<table>
				<form action="Login" method="post">
					<tr>
						<td colspan="2">
							<%
								if (getErr != null) {
									out.println("<font color=\"#FF0000\">" + getErr + "</font>");
									session.removeAttribute("thongbao");
								}
							%>
						</td>
					</tr>
					<tr>
						<td>Tên Email:</td>
						<td><input type="text" name="email" /></td>
					</tr>
					<tr>
						<td>Mật khẩu:</td>
						<td><input type="password" name="passwd" /></td>
					</tr>
					<tr>
						<td></td>
						<td><label><input type="checkbox" name="remem"
								value="checked" /> Ghi nhớ</label></td>
					</tr>
					<tr>
						<td></td>
						<td><input type="submit" value="Đăng nhập" /></td>
					</tr>
					<tr>
						<td></td>
						<td><a href="forgotPassword.jsp">Quên Mật khẩu</a></td>
					</tr>

				</form>

			</table>

		</fieldset>
	</center>
</body>
</html>